package com.company;

import com.company.decorator.SimpleCar;
import com.company.decorator.Car;
import com.company.decorator.CYCarDecorator;
import com.company.decorator.QJ360CarDecorator;

/**
 * 装饰器模式测试代码
 */
public class TestForDecorator {

    public static void main(String[] args) {
        /**
         * 物品价格列表如下：
         * 裸车         70万
         * 车衣         3万
         * 360全景影像  1万
         */

        //裸车
        Car car = new SimpleCar();
        System.out.println(car.getDescription()+", 总价格："+car.getPrice()+"万");

        System.out.println("===============================");

        //加装了车衣
        car = new CYCarDecorator(car);
        System.out.println(car.getDescription()+", 总价格："+car.getPrice()+"万");

        System.out.println("===============================");

        //加装了360度全景影像
        car = new QJ360CarDecorator(car);
        System.out.println(car.getDescription()+", 总价格："+car.getPrice()+"万");
    }
}
